<?php
namespace App\Facades;


use Monolog\Logger as MonologLogger;

class Logger
{
    private static ?MonologLogger $instance = null;

    public static function __callStatic(string $method, array $args)
    {
        if (!self::$instance) {
            self::initialize();
        }
        
        return self::$instance->{$method}(...$args);
    }

    private static function initialize(): void
    {
        $container = \Bootstrap\App::build();
        self::$instance = $container->get(\Psr\Log\LoggerInterface::class);
    }
}
